package com.chengcang.admin.modules.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chengcang.admin.modules.sys.dao.SysUserTenantDao;
import com.chengcang.admin.modules.sys.dto.SysUserTenantDTO;
import com.chengcang.admin.modules.sys.entity.SysUserTenantEntity;
import com.chengcang.admin.modules.sys.service.SysUserTenantService;
import com.chengcang.common.service.impl.CrudServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 用户租户中间表
 *
 * @author zhanli
 * @since 1.0.0 2023-01-06
 */
@Service
public class SysUserTenantServiceImpl extends CrudServiceImpl<SysUserTenantDao, SysUserTenantEntity, SysUserTenantDTO> implements SysUserTenantService {

    @Override
    public QueryWrapper<SysUserTenantEntity> getWrapper(Map<String, Object> params){
        String id = (String)params.get("id");

        QueryWrapper<SysUserTenantEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtils.isNotBlank(id), "id", id);

        return wrapper;
    }


}